import { useEffect } from "react";
import { knowledgeModelState, useDispatch, useSelector } from "umi";
import style from "./style.less"
export default function ArticleLabel() {
    const Dispatch = useDispatch();
    useEffect(() => {
        Dispatch({
            type: "knowledge/getarticlelabel",
        })
    }, [])
    const { ArticleLabel } = useSelector((state: { knowledge: knowledgeModelState }) => {
        return state.knowledge
    });
    return (
        <div className={style.label}>
            <h2>文章标签</h2>
            <ul className={style.label_ul}>
                {
                    ArticleLabel.map(item=>{
                        return <li><span>{item.label}[{item.articleCount}]</span> </li>
                    })
                }
            </ul>
        </div>
    );
}
